// calling/executing context, variables scope
var x = 10; // comment this line,what  happens?

// move the function body into the self-executing function,
// what happens?
function foo() {
  console.log(x);
}

(function () {
  var x = 20;
  foo(); // 10, not 20, but why?
})();
